/*
 * GPSBuffer.h
 *
 *  Created on: Jul 7, 2012
 *      Author: jmurray
 */

#ifndef GPSBUFFER_H_
#define GPSBUFFER_H_

#define GPSBuferSize 256

#include <Arduino.h>

struct GpsDataHolder{
               uint8_t hour;
               uint8_t minute;
               uint16_t second;
         };

class GPSBuffer
{
   public:
      GPSBuffer( );

      // User Functions

      // Get the distance to the given location
      //int getDistance(struct GpsDataHolder locLat, struct GpsDataHolder locLon);

      void stateMachine();
      void parseGPRMC(void);

      // Variables
      char inputBuffer[GPSBuferSize];
      unsigned char head;
      unsigned char tail;
      char state;
      unsigned long lastUpdate;

      int speed;
      uint16_t heading;
      struct GpsDataHolder lat,lon;
};

extern GPSBuffer GPS;

#endif /* GPSBUFFER_H_ */

// GPS State machine:
/*
 *
 */
